﻿using UnityEngine;
using System.Collections;

public class ChangedHud {
	private UITextInstance txtMoney;
    private UITextInstance txtCanPick;
    private UITextInstance txtMessage;
	private UIText txtTe;
	private UIToolkit _utFonts;
	
	public UIToolkit UtFonts
	{
		get { return _utFonts; } 
		set { _utFonts = value; } 
	}
	
	public void CreateHUDChanged(){
		CreateControls();
		PutActions();
		PositionMenu();
	}
	
	private void CreateControls()
	{
		txtTe = new UIText(UtFonts, "prototype", "prototype.png" );
		txtMoney = txtTe.addTextInstance( "$ "+ScreenGeneral.Neko.Money.ToString() , 0, 0 );
        txtMessage = txtTe.addTextInstance("", 10, ScreenGeneral.pieceY/2);
        txtCanPick = txtTe.addTextInstance(SetTextPickUp(), 0, 30);
	}
	
	private void PutActions(){}
	
	private void PositionMenu()
	{
		txtMoney.pixelsFromTopLeft( 0, 0 );
	}
	
	public void UpdateHUD()
	{
		txtMoney.text = "$ "+ScreenGeneral.Neko.Money.ToString() ;
        txtCanPick.text = SetTextPickUp();
        txtMessage.text = ScreenGeneral.message;
		txtTe.updateText(txtMoney);
        txtTe.updateText(txtCanPick);
        txtTe.updateText(txtMessage);
	}

    public string SetTextPickUp()
    {
        if (ScreenGeneral.CanPickUp)
            return "RECOGER";
        else
            return "";
    }
}
